package com.woniuxy.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.commons.model.Result;
import com.woniuxy.controller.form.GetFoodMonthStacForm;
import com.woniuxy.dao.model.DietOrderFood;
import com.woniuxy.service.DietOrderFoodService;
import com.woniuxy.service.dto.FoodMonthStacDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author psy
 * @since 2022-06-28
 */
@RestController
@RequestMapping("/dietOrderFood")
@Api(tags = "菜品月销量统计接口")
public class DietOrderFoodController {

    @Autowired
    private DietOrderFoodService dietOrderFoodService;

    /**
     * 菜品月销量统计操作接口
     * @param gfmsf
     * @return
     */
    @ApiOperation("菜品月销量统计操作接口")
    @PostMapping("/getFoodMonthStac")
    public Result foodMonthStac(@RequestBody GetFoodMonthStacForm gfmsf){

        Page<FoodMonthStacDto> foodStac = dietOrderFoodService.getFoodStac(gfmsf.getPageNum(), gfmsf.getPageSize());

        return Result.success(200,"查询菜品月销量成功",foodStac);
    }
}

